
// char int short long float double 
/*
char/8/-128~127
unsigned char/8/0~255

short/16/-32768~32767
unsigned short/16/0~65535

int/32/-21亿~21亿

long/32/-21亿~21亿
unsigned long/32/0~42亿

float/32
double/64

*/
#include<stdio.h>

int main(int argc, char *argv[]){
	short s=15;
	printf("short s is %i \n", s);
	s = 100000;//溢出
	printf("short s is %hi \n", s);

	int x = 7;
	int y = 2;
	float z = x / y;
	printf("z = x / y is %f \n", z);
		
	float z1 = (float)x / y;
	printf("z = (float)x / y is %f \n", z1);

	printf("sum = sumint(1+5) is %i \n", sumint(1+5));

	printf("sum = sumfloat(1+5) is %F \n", sumfloat(1.0+5.3)); // 此处编译器会假设sumfloat会返回int，但是其实返回的是float，所以会报返回类型冲突的错误

	return 0;

}

int sumint(int x, int y){
	return x + y;
}

float sumfloat(float x, float y){
	return x + y;
}

/*
[root@localhost variablestyle]# gcc variable.c -o variable
variable.c: In function ‘main’:
variable.c:24: warning: overflow in implicit constant conversion
variable.c: At top level:
variable.c:47: error: conflicting types for ‘sumfloat’
variable.c:37: note: previous implicit declaration of ‘sumfloat’ was here

*/
